This invention relates to an inspection apparatus for making an inspection by image processing such as a semiconductor inspection apparatus and a foreign matter inspection apparatus for foods or the like.
The conventional inspection apparatus using the image processing is available which can make a highly accurate inspection by optimizing the image processing algorithm.
In the conventional inspection apparatus, for example, the foreign matter contained in a package of frozen foods is detected by the image processing of an X-ray image and an image processing algorithm optimized in accordance with the user situation is automatically generated by use of GA (Genetic Algorithms).
The image processing using GA is explained in detail in Japanese book, in Chapter 5 of “Phylogenetic Image Processing” by Tomoharu Nagao, published by Shokodo. In this image processing, a filter tree with a one-input one-output filter and a two-input one-output filter (constituting a gene) combined into a tree structure is regarded as a chromosome. The chromosome of the next-generation population (mass of chromosomes) is generated by selection, crossing-over and mutation of the current-generation population. In this way, the population makes an evolution in each generation. The direction of evolution is defined by a set of a predetermined original image and a target image (which may include a weighted image, as required), and image processing algorithms (chromosomes) more and more evolved with the original image approaching a target image come to appear in greater numbers through generations.
In this invention, a set of an original image and a target image (and a weighted image in some cases) is referred to as a teacher data set. Although one teacher data set serves the purpose, a plurality of teacher data sets generally exist, and the target image and the weighted image, as compared with the original image, are required to be generated manually. A particular desired image processing algorithm formed by the target image and the weighted image is taught to a system by the human being.
FIGS. 12A to 12D show the manner in which the image processing algorithm for detecting foreign matter in a frozen food is generated by the phylogenetic image processing. FIG. 12A shows the positions of the foreign matter contained in the package of the frozen pilaf constituting a frozen food. The outer peripheral portion where nothing is contained is high in X-ray transmittance and white in color. Inside the package, rice grains and other ingredients appear as an white-flecked image. FIG. 2B shows the original image (not the original image in the teacher data set) as it is. FIG. 12C shows an original image processed by the image processing algorithm (chromosome) formed by the learning (optimization) using the teacher data set and obtained at about the 10th generation. The pixel value at the coordinate having the foreign matter is seen to have become higher than that of rice grains. FIG. 12D, on the other hand, shows an original image processed by the image processing algorithm obtained at about the 100th generation. Once the stage as far as this is reached, the presence or absence can be stably detected with the pixel value of about 6 or 7 as a threshold. In the case under consideration, the last process for detecting the presence or absence of foreign matter using a threshold is not included in the image processing algorithm to be optimized. As described above, all the processes before determining the detection result are not necessarily optimized.
FIGS. 13A to 13D show an example of the target image and the weighted image obtained in this case. FIG. 13A shows an example of the target image involved, in which the pixel values at the positions of foreign matter contained are shown high. The system optimizes the image processing algorithm to obtain this image of the processing result. Specifically, the chromosomes of each generation are evaluated as to the degree to which the result of processing is different from a target image, and if low in evaluation (with the processing result considerably different from the target image), selected and cannot survive to the next generation. In the process, what is important is the degree to which the processing result is different from the target image. In the case where the greater part of the target image is black and only a small part thereof is white as shown in FIG. 13B, a chromosome by which a deep black image is output as the processing result would also gain a high evaluation. Such a chromosome (image processing), however, has no actual significance. In such a case, the condition that the position where foreign matter is contained is as white as in the target image is given priority (weighted) in evaluation, and therefore, the weighted image as shown in FIG. 13C is effectively used. In the weighted image, the coordinate higher in pixel value is weighted more to evaluate the difference from the target image.
On the other hand, JP-A-7-121494 discloses a neural network (perceptron) in which the desired output signal can be easily obtained also for the non-learning input signal by simple learning using the learning input signal and the corresponding teacher signal. It is well known that the pattern can be recognized from the image also using this neural network. Also in this case, a set of the learning input signal and the teacher signal is required to be prepared in advance. The set of the learning input signal and the teacher signal is also called a teacher data set according to this invention. In the pattern recognition using the neural network, the preprocessing such as the noise elimination may be carried out on the input image. According to this invention, however, such a preprocessing is not included in the learning (optimization).